package com.lantosec.hmrp.modules.warning.vo;

import com.lantosec.hmrp.core.mvc.BaseVO;
import com.lantosec.hmrp.modules.warning.entity.WarningRule;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * <p>
 * 预警规则 VO对象
 * </p>
 *
 * @author AutoCode
 * @since 2020-05-19
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="WarningRule对象", description="预警规则")
public class WarningRuleVO extends BaseVO<WarningRule> {
    private static final long serialVersionUID = 1L;


    public WarningRuleVO(WarningRule entity){
        this.ruleId = entity.getRuleId();
        this.ruleName = entity.getRuleName();
        this.typeId = entity.getTypeId();
        this.warningGrade = entity.getWarningGrade();
        this.dataSourceType = entity.getDataSourceType();
        this.dataSource = entity.getDataSource();
        this.runCycleType = entity.getRunCycleType();
        this.runMonth = entity.getRunMonth();
        this.runDay = entity.getRunDay();
        this.runHour = entity.getRunHour();
        this.runMinute = entity.getRunMinute();
        this.startDate = entity.getStartDate();
        this.endDate = entity.getEndDate();
        this.tableDefine = entity.getTableDefine();
        this.repeatFilterSql = entity.getRepeatFilterSql();
        this.repeatFilterField = entity.getRepeatFilterField();
        this.thresholdValue = entity.getThresholdValue();
        this.disposalMode = entity.getDisposalMode();
        this.deptField = entity.getDeptField();
        this.userField = entity.getUserField();
        this.dataTimeField = entity.getDataTimeField();
        this.createUserId = entity.getCreateUserId();
        this.createUser = entity.getCreateUser();
        this.createTime = entity.getCreateTime();
        this.editUserId = entity.getEditUserId();
        this.editUser = entity.getEditUser();
        this.editTime = entity.getEditTime();
        this.flag = entity.getFlag();
        this.repeal = entity.getRepeal();
        this.chargeDept = entity.getChargeDept();
    }

    @Override
    public WarningRule convertToEntity(){
        return new WarningRule(this);
    }


    @ApiModelProperty(value = "预警规则ID")
    private String ruleId;

    @ApiModelProperty(value = "预警规则名称")
    private String ruleName;

    @ApiModelProperty(value = "预警类型ID")
    private String typeId;

    @ApiModelProperty(value = "预警等级(1一级2二级3三级)")
    private Integer warningGrade;

    @ApiModelProperty(value = "数据源类型(1SQL匹配)")
    private Integer dataSourceType;

    @ApiModelProperty(value = "数据源")
    private String dataSource;

    @ApiModelProperty(value = "运行周期类型(1定时2及时)")
    private Integer runCycleType;

    @ApiModelProperty(value = "运行指定月份")
    private Integer runMonth;

    @ApiModelProperty(value = "运行指定日期")
    private Integer runDay;

    @ApiModelProperty(value = "运行指定小时")
    private Integer runHour;

    @ApiModelProperty(value = "运行指定分钟")
    private Integer runMinute;

    @ApiModelProperty(value = "运行开始日期")
    private String startDate;

    @ApiModelProperty(value = "运行结束日期")
    private String endDate;

    @ApiModelProperty(value = "预警数据表格定义JSON")
    private String tableDefine;

    @ApiModelProperty(value = "重复过滤SQL")
    private String repeatFilterSql;

    @ApiModelProperty(value = "重复过滤字段列表,分隔")
    private String repeatFilterField;

    @ApiModelProperty(value = "阀值列表,分隔")
    private String thresholdValue;

    @ApiModelProperty(value = "处置方式(1普通处置2考评处置)")
    private Integer disposalMode;

    @ApiModelProperty(value = "部门字段定义")
    private String deptField;

    @ApiModelProperty(value = "用户字段定义")
    private String userField;

    @ApiModelProperty(value = "数据时间字段定义")
    private String dataTimeField;

    @ApiModelProperty(value = "创建人ID")
    private String createUserId;

    @ApiModelProperty(value = "创建人")
    private String createUser;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "修改人ID")
    private String editUserId;

    @ApiModelProperty(value = "修改人")
    private String editUser;

    @ApiModelProperty(value = "修改时间")
    private Date editTime;

    @ApiModelProperty(value = "废止标识 0启用1禁止")
    private Integer repeal;

    @ApiModelProperty(value = "处置科室")
    private String chargeDept;

    private Integer flag;

}
